//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
#ifndef _ListAncestorMol_H
#define	_ListAncestorMol_H
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
#include "AncestorMol.h"
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
class ListAncestorMol {
  
  private:

    String*               filenameAncestor;
    String*               filenameSmiles;

    TListE <AncestorMol>* listAncestor;

    bool                   fileAncestorGZ;
    bool                   fileSmilesGZ;

  protected:

    void                  CenterListByLingoSim(TListE <AncestorMol>*, SmileStruct*);
    void                  ListOriginalAncestor(TListE <AncestorMol>*, TListE <AncestorMol>*, int);
    
  public:
    
    ListAncestorMol();
    ListAncestorMol(String*, String*);
    ListAncestorMol(ListAncestorMol&);
    ListAncestorMol(ListAncestorMol*);

    ~ListAncestorMol();

    void                  FilenameAncestor(String*);
    void                  FilenameAncestor(char*);
    void                  FilenameSmiles(String*);
    void                  FilenameSmiles(char*);
    void                  ListAncestor(TListE <AncestorMol>*);
    void                  FileAncestorGZ(bool);
    void                  FileSmilesGZ(bool);

    String*               FilenameAncestor();
    String*               FilenameSmiles();
    TListE <AncestorMol>* ListAncestor();
    bool                  FileAncestorGZ();
    bool                  FileSmilesGZ();

    bool                  LoadDataAncestorFiles();
    bool                  LoadDataAncestorFilesFrom(long, long);
    bool                  LoadDataSmilesFiles();
    bool                  LoadDataFiles();
    bool                  LoadDataFileFrom(long, long);

    bool                  WriteAncestorFile();
    bool                  WriteAncestorFileFrom(long, long);

    bool                  WriteSmilesFile();
    bool                  WriteSmilesFileFrom(long, long);

    bool                  WriteSmilesAncestorFile(int, String*);
    bool                  WriteSmilesAncestorFile(int, const char*);

    int                   WriteClusterByAncestorFile(int, char*);
    int                   WriteClusterByAncestorFileInfo(int, char*);

    bool                  OrderListByAncestorDescendentIterative();
    bool                  OrderListByAncestorAscendentIterative();
    bool                  OrderListByAncestorCenteredIterative();
    bool                  OrderListByAncestorCenteredIterativeX();

    bool                  OrderListByAncestorDescendent();
    bool                  OrderListByAncestorAscendent();
    bool                  OrderListByAncestorCentered();

    double                ComputeConvergenceAncestorFile(String*);
    double                ComputeConvergenceClusterSim(String*);

    double                ComputeSumConvergenceAncestorFile(String*, long&);
    double                ComputeSumConvergenceClusterSim(String*, double&, double&);

    double                ComputeClusterSimilarity(String*, int, int);
    
    ListAncestorMol       operator=(ListAncestorMol&);

};
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
#endif	
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
